package component;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor;
import org.springframework.core.PriorityOrdered;

/**
 * @author: ZhouBert
 * @date: 2020/8/28
 * @description:	测试拓展 BeanDefinitionRegistryPostProcessor 和 PriorityOrdered 接口
 */
public class TestBeanDefinitionRegistryPostProcessorPriorityOrdered implements BeanDefinitionRegistryPostProcessor, PriorityOrdered {

	public TestBeanDefinitionRegistryPostProcessorPriorityOrdered(){
		System.out.println("TestBeanDefinitionRegistryPostProcessorPriorityOrdered 被创建了");
	}

	@Override
	public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
		System.out.println("MyBeanDefinitionRegistryPostProcessorPriorityOrdered postProcessBeanDefinitionRegistry");
	}

	@Override
	public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
		System.out.println("MyBeanDefinitionRegistryPostProcessorPriorityOrdered postProcessBeanFactory");
	}

	@Override
	public int getOrder() {
		return 1;
	}
}
